package niuke;

import java.util.Scanner;

public class 字符串中找出最长的数字串 {

    static int maxLength = -1;
    static int start=0,end=0;
    static int maxStart=0,maxEnd=0;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        f(str);
        System.out.println(str.substring(maxStart,maxEnd+1));
    }

    public static void f(String str){
        //遍历判断
        for(int i=0;i<str.length();i++){
            int c = (int)str.charAt(i) - 48;
            //如果是数字
            if(c>=0 && c<=9){
                end = i;
            }
            else {
                if(end > start && end-start > maxLength){
                    maxLength = end - start;
                    maxStart = start;
                    maxEnd = end;
                }
                start = i+1;
            }
        }
        if(end > start && end-start > maxLength){
            maxLength = end - start;
            maxStart = start;
            maxEnd = end;
        }
    }
}
